/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SStoreConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.user.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.user.APermObjects;
import com.thor.palmmall.spi.user.SPermObjects;

/**
 * @author captain
 *
 */
public class APermObjectsConverter implements Converter<SPermObjects, APermObjects> {

  public static APermObjectsConverter getInstance() {
    if (instance == null)
      instance = new APermObjectsConverter();
    return instance;
  }

  private static APermObjectsConverter instance;

  private APermObjectsConverter() {
  }

  @Override
  public APermObjects convert(SPermObjects source) {
    if (source == null)
      return null;

    APermObjects target = new APermObjects();
    target.setId(source.getId());
    target.setPermEnabled(source.getPermEnabled());
    target.setTitle(source.getTitle());
    return target;
  }

}
